#include "sk_game_shape.h"
#include "sk_b2_properties_helper.h"

namespace sk
{

GameShape::GameShape()
{
}

GameShape::~GameShape()
{

}

void GameShape::serialize(QDomDocument * doc, QDomElement * e)
{
    serialiseCustomShapeData(doc, e);
    B2PropertiesHelper::serialize(doc, e, &bodyDef);
    B2PropertiesHelper::serialize(doc, e, &fixtureDef);
}

b2Body * GameShape::addToWorld(b2World *)
{
    return 0;
}

bool GameShape::deserialize(QDomElement * e)
{
    if (!deserialiseCustomShapeData(e))
    {
        return false;
    }
    if (!B2PropertiesHelper::deserialize(e, &bodyDef))
    {
        return false;
    }
    if (!B2PropertiesHelper::deserialize(e, &fixtureDef))
    {
        return false;
    }
    return true;
}

void GameShape::serialiseCustomShapeData(QDomDocument *, QDomElement *)
{
}

bool GameShape::deserialiseCustomShapeData(QDomElement *)
{
    return true;
}

}; //namespace sk



